<?php
defined('IN_DC') or exit('Access Denied');

$catcode = isset($catcode) && !empty($catcode) ? intval($catcode) : exit($lang['catcode_canot_be_empty']);
$catval = $CAT[$catcode];




$html .= $catval['catname']."<br/>";
$r = $db->get_one("SELECT COUNT(id) as count FROM ".DB_PRE."shop WHERE `catcode` LIKE '$catcode%' AND `areacode` LIKE '$acode%' AND status = 1");
$num = $r['count'];
$pagesize = 20; 
$page = isset($page) && !empty($page) ? intval($page) : 1;
$offset = ($page-1)*$pagesize;
$pages = wml_pages($num, $page, 'index.php?action='.$action.'&amp;catcode='.$catcode.$cityparam.'&amp;page=', $pagesize);
$r = $db->query("SELECT shopname,id FROM ".DB_PRE."shop WHERE `catcode` LIKE '$catcode%' AND `areacode` LIKE '$acode%' AND status = 1 ORDER BY id DESC LIMIT $offset,$pagesize");
while($s = $db->fetch_array($r)) 
{
	$html .= '<a href="index.php?action=shopshow&amp;id='.$s['id'].$cityparam.'">'.wml_strip($s['shopname']).'</a><br/>';
}
$html .= $pages;
$html .= '<br/><a href="index.php'.$cityparamindex.'">'.$lang['return_index'].'</a><br/>';
?>